//
// Copyright (C) 2011 Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.101
//#include "stdafx.h"
#include "IborIndex.h"
using namespace Cephei::QL::Indexes;
#include <gen/QL/Termstructures/YieldTermStructure.h>
#include <gen/QL/Times/Period.h>
#include <gen/QL/Currency.h>
#include <gen/QL/Times/Calendar.h>
#include <gen/QL/Times/DayCounter.h>
#include <gen/QL/Indexes/InterestRateIndex.h>
using namespace Cephei::QL::Termstructures;
using namespace Cephei::QL::Times;
using namespace Cephei::QL;
#define HANDLE
#undef ABSTRACT
#undef STRUCT
Cephei::QL::Indexes::CIborIndex::CIborIndex (String^ familyName, Cephei::QL::Times::IPeriod^ tenor, UInt32 settlementDays, Cephei::QL::ICurrency^ currency, Cephei::QL::Times::ICalendar^ fixingCalendar, QL::Times::BusinessDayConventionEnum convention, Boolean endOfMonth, Cephei::QL::Times::IDayCounter^ dayCounter, Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Termstructures::IYieldTermStructure^>^ h) : CInterestRateIndex(CIborIndex::typeid)
{
    CPeriod^ _Ctenor;
    CCurrency^ _Ccurrency;
    CCalendar^ _CfixingCalendar;
    CDayCounter^ _CdayCounter;
    CYieldTermStructure^ _Ch;
    try
    {
#ifdef HANDLE
        _phIborIndex = NULL;
#endif
        std::string _familyName = (std::string)ValueHelper::Convert (familyName);
        _Ctenor = safe_cast<CPeriod^> (tenor);
        _Ctenor->Lock();
        QuantLib::Period& _tenor = static_cast<QuantLib::Period&> (_Ctenor->GetReference ()); 
        QuantLib::Natural _settlementDays = (QuantLib::Natural)ValueHelper::Convert (settlementDays);
        _Ccurrency = safe_cast<CCurrency^> (currency);
        _Ccurrency->Lock();
        QuantLib::Currency& _currency = static_cast<QuantLib::Currency&> (_Ccurrency->GetReference ()); 
        _CfixingCalendar = safe_cast<CCalendar^> (fixingCalendar);
        _CfixingCalendar->Lock();
        QuantLib::Calendar& _fixingCalendar = static_cast<QuantLib::Calendar&> (_CfixingCalendar->GetReference ()); 
        QuantLib::BusinessDayConvention _convention = (QuantLib::BusinessDayConvention)convention ;
        bool _endOfMonth = (bool)ValueHelper::Convert (endOfMonth);
        _CdayCounter = safe_cast<CDayCounter^> (dayCounter);
        _CdayCounter->Lock();
        QuantLib::DayCounter& _dayCounter = static_cast<QuantLib::DayCounter&> (_CdayCounter->GetReference ()); 
        if (Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Termstructures::IYieldTermStructure^>::IsSome::get (h))
        {
            _Ch = safe_cast<CYieldTermStructure^> (h->Value);
            _Ch->Lock();
        }
        Handle<QuantLib::YieldTermStructure>& _h = 
            (Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Termstructures::IYieldTermStructure^>::IsSome::get (h) ? static_cast<Handle<QuantLib::YieldTermStructure>&> (_Ch->GetHandle ()) : Handle<QuantLib::YieldTermStructure>()); //1
        _ppIborIndex = new boost::shared_ptr<QuantLib::IborIndex> (new QuantLib::IborIndex ( _familyName,  _tenor,  _settlementDays,  _currency,  _fixingCalendar,  _convention,  _endOfMonth,  _dayCounter,  _h ));
        SetInterestRateIndex (boost::dynamic_pointer_cast<QuantLib::InterestRateIndex> (*_ppIborIndex));
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
        if (_Ctenor != nullptr) _Ctenor->Unlock();
        if (_Ccurrency != nullptr) _Ccurrency->Unlock();
        if (_CfixingCalendar != nullptr) _CfixingCalendar->Unlock();
        if (_CdayCounter != nullptr) _CdayCounter->Unlock();
        if (_Ch != nullptr) _Ch->Unlock();
    }
}
Cephei::QL::Indexes::CIborIndex::CIborIndex (boost::shared_ptr<QuantLib::IborIndex>& childNative, Object^ owner) : CInterestRateIndex(CIborIndex::typeid)
{
#ifdef HANDLE
	_phIborIndex = NULL;
#endif
	_ppIborIndex = &childNative;
    _ppInterestRateIndex = new boost::shared_ptr<QuantLib::InterestRateIndex> (boost::dynamic_pointer_cast<QuantLib::InterestRateIndex> (*_ppIborIndex));
}
Cephei::QL::Indexes::CIborIndex::CIborIndex (QuantLib::IborIndex& childNative, Object^ owner) : CInterestRateIndex(CIborIndex::typeid)
{
#ifdef HANDLE
	_phIborIndex = NULL;
#endif
	_ppIborIndex = new boost::shared_ptr<QuantLib::IborIndex> (&childNative);
    _ppInterestRateIndex = new boost::shared_ptr<QuantLib::InterestRateIndex> (boost::dynamic_pointer_cast<QuantLib::InterestRateIndex> (*_ppIborIndex));
    _IborIndexOwner = owner;
    _InterestRateIndexOwner = owner;
}

Cephei::QL::Indexes::CIborIndex::CIborIndex (CIborIndex^ copy) : CInterestRateIndex(CIborIndex::typeid)
{
#ifdef HANDLE
	_phIborIndex = NULL;
#endif
	if (copy->HasNative() != NULL)
    {
		_ppIborIndex = new boost::shared_ptr<QuantLib::IborIndex> (copy->GetShared());
        _ppInterestRateIndex = new boost::shared_ptr<QuantLib::InterestRateIndex> (boost::dynamic_pointer_cast<QuantLib::InterestRateIndex> (*_ppIborIndex));
    }
}
Cephei::QL::Indexes::CIborIndex::CIborIndex (System::Type^ t) : CInterestRateIndex(CIborIndex::typeid)
{
#ifdef HANDLE
	_phIborIndex = NULL;
#endif
	if (!t->IsSubclassOf(CIborIndex::typeid))
		throw gcnew Exception ("Invalid base-case init");
}
#ifdef HANDLE
Cephei::QL::Indexes::CIborIndex::CIborIndex (QuantLib::Handle<QuantLib::IborIndex>& childNative, Object^ owner)  : CInterestRateIndex(CIborIndex::typeid)
{
	_phIborIndex = &childNative;
	_ppIborIndex = &static_cast<boost::shared_ptr<QuantLib::IborIndex>>(childNative.currentLink());
    _ppInterestRateIndex = new boost::shared_ptr<QuantLib::InterestRateIndex> (boost::dynamic_pointer_cast<QuantLib::InterestRateIndex> (*_ppIborIndex));
    _IborIndexOwner = owner;
}
Cephei::QL::Indexes::CIborIndex::CIborIndex (QuantLib::Handle<QuantLib::IborIndex> childNative)  : CInterestRateIndex(CIborIndex::typeid)
{
	_phIborIndex = &childNative;
	_ppIborIndex = &static_cast<boost::shared_ptr<QuantLib::IborIndex>>(childNative.currentLink());
    _ppInterestRateIndex = new boost::shared_ptr<QuantLib::InterestRateIndex> (boost::dynamic_pointer_cast<QuantLib::InterestRateIndex> (*_ppIborIndex));
}
#endif
#ifdef STRUCT
Cephei::QL::Indexes::CIborIndex::CIborIndex (QuantLib::IborIndex childNative)  : CInterestRateIndex(CIborIndex::typeid)
{
#ifdef HANDLE
	_phIborIndex = NULL;
#endif
	_ppIborIndex = new boost::shared_ptr<QuantLib::IborIndex> (new QuantLib::IborIndex (childNative));
    _ppInterestRateIndex = new boost::shared_ptr<QuantLib::InterestRateIndex> (boost::dynamic_pointer_cast<QuantLib::InterestRateIndex> (*_ppIborIndex));
}
#endif

Cephei::QL::Indexes::CIborIndex::~CIborIndex ()
{
    if (_ppIborIndex != NULL)
    {
	    delete _ppIborIndex;
        _ppIborIndex = NULL;
    }
}
Cephei::QL::Indexes::CIborIndex::!CIborIndex ()
{
    if (_ppIborIndex != NULL)
    {
	    delete _ppIborIndex;
    }
}
QuantLib::IborIndex& Cephei::QL::Indexes::CIborIndex::GetReference ()
{
    if (_ppIborIndex == NULL) throw gcnew NativeNullException ();
	return **_ppIborIndex;
}
boost::shared_ptr<QuantLib::IborIndex>& Cephei::QL::Indexes::CIborIndex::GetShared ()
{
    if (_ppIborIndex == NULL) throw gcnew NativeNullException ();
	return *_ppIborIndex;
}
QuantLib::IborIndex* Cephei::QL::Indexes::CIborIndex::GetPointer ()
{
    if (_ppIborIndex == NULL) throw gcnew NativeNullException ();
	return &**_ppIborIndex;
}
#ifdef HANDLE
QuantLib::Handle<QuantLib::IborIndex>& Cephei::QL::Indexes::CIborIndex::GetHandle ()
{
	if (_phIborIndex == NULL)
	{
		_phIborIndex = new Handle<QuantLib::IborIndex> (*_ppIborIndex);
	}
	return *_phIborIndex;
}
#endif
bool Cephei::QL::Indexes::CIborIndex::HasNative () 
{
	return (_ppIborIndex != NULL);
}

QL::Times::BusinessDayConventionEnum Cephei::QL::Indexes::CIborIndex::BusinessDayConvention::get ()
{
    try
    {
    	QuantLib::BusinessDayConvention _rv = (QuantLib::BusinessDayConvention)(*_ppIborIndex)->businessDayConvention ( );   
        QL::Times::BusinessDayConventionEnum _nrv = (QL::Times::BusinessDayConventionEnum)_rv;
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::Indexes::IIborIndex^ Cephei::QL::Indexes::CIborIndex::Clone (Cephei::QL::Termstructures::IYieldTermStructure^ forwarding)
{
    CYieldTermStructure^ _Cforwarding;
    try
    {
        _Cforwarding = safe_cast<CYieldTermStructure^> (forwarding);
        _Cforwarding->Lock();
        Handle<QuantLib::YieldTermStructure>& _forwarding = static_cast<Handle<QuantLib::YieldTermStructure>&> (_Cforwarding->GetHandle ()); 
    	boost::shared_ptr<QuantLib::IborIndex> _rv = (boost::shared_ptr<QuantLib::IborIndex>)(*_ppIborIndex)->clone ( _forwarding );   
        Cephei::QL::Indexes::CIborIndex^ _nrv = gcnew Cephei::QL::Indexes::CIborIndex (_rv, this);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
        if (_Cforwarding != nullptr) _Cforwarding->Unlock();
    }
}
Boolean Cephei::QL::Indexes::CIborIndex::EndOfMonth::get ()
{
    try
    {
    	bool _rv = (bool)(*_ppIborIndex)->endOfMonth ( );   
        Boolean _nrv = (Boolean)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
DateTime Cephei::QL::Indexes::CIborIndex::MaturityDate (DateTime valueDate)
{
    try
    {
        QuantLib::Date _valueDate = (QuantLib::Date)ValueHelper::Convert (valueDate);
    	QuantLib::Date _rv = (QuantLib::Date)(*_ppIborIndex)->maturityDate ( _valueDate );   
        DateTime _nrv = (DateTime)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::Termstructures::IYieldTermStructure^ Cephei::QL::Indexes::CIborIndex::ForwardingTermStructure::get ()
{
    try
    {
    	Handle<QuantLib::YieldTermStructure> _rv = (Handle<QuantLib::YieldTermStructure>)(*_ppIborIndex)->forwardingTermStructure ( );   
        Cephei::QL::Termstructures::CYieldTermStructure^ _nrv = gcnew Cephei::QL::Termstructures::CYieldTermStructure (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::Indexes::CIborIndexVector::CIborIndexVector ()
{
#ifdef STRUCT
	_pVValue = NULL;
#endif
	_pVBoost = NULL;
#ifdef HANDLE
	_pVHand = NULL;
#endif
}
Cephei::QL::Indexes::CIborIndexVector::~CIborIndexVector ()
{
#ifdef STRUCT
	if (_pVValue != NULL) delete _pVValue;
	_pVValue = NULL;
#endif   
	if (_pVBoost != NULL) delete _pVBoost;
	_pVBoost = NULL;
#ifdef HANDLE
	if (_pVHand != NULL) delete _pVHand;
	_pVHand = NULL;
#endif
}
Cephei::QL::Indexes::CIborIndexVector::!CIborIndexVector ()
{
#ifdef STRUCT
	if (_pVValue != NULL) delete _pVValue;
#endif   
	if (_pVBoost != NULL) delete _pVBoost;
#ifdef HANDLE
	if (_pVHand != NULL) delete _pVHand;
#endif
}
#ifdef STRUCT
Cephei::QL::Indexes::CIborIndexVector::CIborIndexVector (std::vector<QuantLib::IborIndex>& vec, Object^ owner)
{
#ifdef STRUCT
	_pVValue = NULL;
#endif
	_pVBoost = NULL;
#ifdef HANDLE
	_pVHand = NULL;
#endif
	_pVValue = &vec;
	_owner = owner;
}
Cephei::QL::Indexes::CIborIndexVector::CIborIndexVector (std::vector<QuantLib::IborIndex> vec)
{
#ifdef STRUCT
	_pVValue = NULL;
#endif
	_pVBoost = NULL;
#ifdef HANDLE
	_pVHand = NULL;
#endif
	_pVValue = new std::vector<QuantLib::IborIndex> (vec);
}
#endif
Cephei::QL::Indexes::CIborIndexVector::CIborIndexVector (std::vector<boost::shared_ptr<QuantLib::IborIndex>>& vec, Object^ owner)
{
#ifdef STRUCT
	_pVValue = NULL;
#endif
	_pVBoost = NULL;
#ifdef HANDLE
	_pVHand = NULL;
#endif
	 _pVBoost = &vec;
	_owner = owner;
}
#ifdef HANDLE
Cephei::QL::Indexes::CIborIndexVector::CIborIndexVector (std::vector<QuantLib::Handle<QuantLib::IborIndex>>& vec, Object^ owner)
{
#ifdef STRUCT
	_pVValue = NULL;
#endif
	_pVBoost = NULL;
#ifdef HANDLE
	_pVHand = NULL;
#endif
	 _pVHand = &vec;
	_owner = owner;
}
#endif

int Cephei::QL::Indexes::CIborIndexVector::Count::get ()
{
#ifdef STRUCT
	if (_pVValue != NULL) 
	{
		return _pVValue->size();
	}
#endif    
	if (_pVBoost != NULL)
	{
		return _pVBoost->size ();
	}
#ifdef HANDLE
	if (_pVHand != NULL)
	{
		return _pVHand->size ();
	}
#endif
	return 0;		// should never happen
}
Cephei::QL::Indexes::IIborIndex^ Cephei::QL::Indexes::CIborIndexVector::default::get (int index) 
{
#ifdef STRUCT
	if (_pVValue != NULL) 
	{
    	if ((size_t)index >= _pVValue->size()) throw gcnew RangeException ();
		QuantLib::IborIndex& native = (*_pVValue)[index];
		return gcnew CIborIndex (native, this);
	}
#endif    
	if (_pVBoost != NULL)
	{
    	if ((size_t)index >= _pVBoost->size()) throw gcnew RangeException ();
		QuantLib::IborIndex& native = *(*_pVBoost)[index];
		return gcnew CIborIndex (native, this);
	}
#ifdef HANDLE
	if (_pVHand != NULL)
	{
    	if ((size_t)index >= _pVHand->size()) throw gcnew RangeException ();
		QuantLib::IborIndex& native = *((*_pVHand)[index].currentLink ());
		return gcnew CIborIndex (native, this);
	}
#endif
	return nullptr;		// can never be the case
}
void Cephei::QL::Indexes::CIborIndexVector::default::set (int index, Cephei::QL::Indexes::IIborIndex^ value) 
{
#ifdef STRUCT
	if (_pVValue != NULL)
	{
		if (_pVValue->size() <= (size_t)index)
		{
			// can't happen because vectors are filled from List<> sequentially
			if (_pVValue->size() < (size_t)index)
			{
				throw gcnew RangeException ();
			}
			_pVValue->push_back (dynamic_cast<CIborIndex^>(value)->GetReference ());
		}
        else
        {
            QuantLib::IborIndex& c = (*_pVValue)[index];
            c = dynamic_cast<CIborIndex^>(value)->GetReference ();
        }
	}
#endif   
	if (_pVBoost != NULL)
	{
		if (_pVBoost->size() <= (size_t)index)
		{
			// can't happen because vectors are filled from List<> sequentially
			if (_pVBoost->size() < (size_t)index)
			{
				throw gcnew RangeException ();
			}
			_pVBoost->push_back (dynamic_cast<CIborIndex^>(value)->GetShared ());
		}
		boost::shared_ptr<QuantLib::IborIndex>& c = (*_pVBoost)[index];
		c = dynamic_cast<CIborIndex^>(value)->GetShared ();
	}
#ifdef HANDLE
	if (_pVHand != NULL)
	{
		if (_pVHand->size() <= (size_t)index)
		{
			// can't happen because vectors are filled from List<> sequentially
			if (_pVHand->size() < (size_t)index)
			{
				throw gcnew RangeException ();
			}
			_pVHand->push_back (QuantLib::Handle<QuantLib::IborIndex> ());
		}
		QuantLib::Handle<QuantLib::IborIndex>& c = (*_pVHand)[index];
		boost::shared_ptr<QuantLib::IborIndex>& b = static_cast<boost::shared_ptr<QuantLib::IborIndex>>(c.currentLink());
		b = dynamic_cast<CIborIndex^>(value)->GetShared ();
	}
#endif
}
Cephei::Generic::ICell<Cephei::QL::Indexes::IIborIndex^>^ Cephei::QL::Indexes::CIborIndexVector::CItem::get (int index) 
{
	return CellBuilder::Instance->Create<IIborIndex^> (dynamic_cast<IIborIndex^>(default[index]));
}

void Cephei::QL::Indexes::CIborIndexVector::CItem::set (int index, Cephei::Generic::ICell<Cephei::QL::Indexes::IIborIndex^>^ value) 
{
	default[index] = safe_cast<IIborIndex^>(value->Value);
}
#ifdef STRUCT
std::vector<QuantLib::IborIndex>& Cephei::QL::Indexes::CIborIndexVector::GetReference ()
{
	 return *_pVValue;
}
#endif

std::vector<boost::shared_ptr<QuantLib::IborIndex>>& Cephei::QL::Indexes::CIborIndexVector::GetShared ()
{
	return *_pVBoost;
}

#ifdef HANDLE
std::vector<QuantLib::Handle<QuantLib::IborIndex>>& Cephei::QL::Indexes::CIborIndexVector::GetHandle ()
{
	return *_pVHand;
}
#endif
bool Cephei::QL::Indexes::CIborIndexVector::PrepareFeature (NativeFeature feature)
{
	switch (feature)
	{
#ifdef STRUCT
		case NativeFeature::Value :
			if (_pVValue == NULL)
			{
				_pVValue = new std::vector<QuantLib::IborIndex> ();
				return true;
			}
			break;
#endif
        case NativeFeature::shared_ptr :
			if (_pVBoost == NULL)
			{
				_pVBoost = new std::vector<boost::shared_ptr<QuantLib::IborIndex>> ();
				return true;
			}
			break;
#ifdef HANDLE
        case NativeFeature::Handle :
            if (_pVHand == NULL)
            {
                _pVHand = new std::vector<QuantLib::Handle<QuantLib::IborIndex>> ();
                return true;
            }
            break;
#endif
	}
	return false;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Factory class

Cephei::QL::Indexes::IIborIndex^ Cephei::QL::Indexes::CIborIndex_Factory::Create (String^ familyName, Cephei::QL::Times::IPeriod^ tenor, UInt32 settlementDays, Cephei::QL::ICurrency^ currency, Cephei::QL::Times::ICalendar^ fixingCalendar, QL::Times::BusinessDayConventionEnum convention, Boolean endOfMonth, Cephei::QL::Times::IDayCounter^ dayCounter, Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Termstructures::IYieldTermStructure^>^ h)
{
    return gcnew CIborIndex ( familyName,  tenor,  settlementDays,  currency,  fixingCalendar,  convention,  endOfMonth,  dayCounter,  h);
}
/* <summary>Create a single dimension array of IborIndex that can be passed into other function </summary> */
IVector<Cephei::QL::Indexes::IIborIndex^>^ Cephei::QL::Indexes::CIborIndex_Factory::CreateVector ()
 {
	 return gcnew CoVector<IIborIndex^> (gcnew CIborIndexVector ());
 }
IVector<Cephei::QL::Indexes::IIborIndex^>^ Cephei::QL::Indexes::CIborIndex_Factory::CreateVector (System::Collections::Generic::IEnumerable<IIborIndex^>^ source)
 {
	 return gcnew CoVector<IIborIndex^> (source, gcnew CIborIndexVector ());
 }
/* <summary>Create a single dimension array of IborIndex with change events</summary> */
Cephei::Generic::ICell<IVector<Cephei::Generic::ICell<Cephei::QL::Indexes::IIborIndex^>^>^>^ Cephei::QL::Indexes::CIborIndex_Factory::CreateCellVector ()
 {
	 return CellBuilder::Instance->Create<IVector<Cephei::Generic::ICell<Cephei::QL::Indexes::IIborIndex^>^>^> (gcnew CoCellVector<Cephei::Generic::ICell<Cephei::QL::Indexes::IIborIndex^>^> (gcnew CIborIndexVector ()));
 }
Cephei::Generic::ICell<IVector<Cephei::Generic::ICell<Cephei::QL::Indexes::IIborIndex^>^>^>^ Cephei::QL::Indexes::CIborIndex_Factory::CreateCellVector (System::Collections::Generic::IEnumerable<Cephei::Generic::ICell<Cephei::QL::Indexes::IIborIndex^>^>^ source)
 {
	 return CellBuilder::Instance->Create<IVector<Cephei::Generic::ICell<Cephei::QL::Indexes::IIborIndex^>^>^> (gcnew CoCellVector<Cephei::Generic::ICell<Cephei::QL::Indexes::IIborIndex^>^> (source, gcnew CIborIndexVector ()));
 }

